package cn.schoolwow.ams.test.module.configParameter.config;

import cn.schoolwow.ams.test.entity.ConfigParameter;
import cn.schoolwow.quickdao.domain.DAO;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InitialConfigParameterBean implements InitializingBean {
    @Autowired
    private DAO starterDAO;

    @Override
    public void afterPropertiesSet() throws Exception {
        ConfigParameter configParameter = new ConfigParameter();
        configParameter.setName("统一认证");
        JSONObject value = new JSONObject();
        value.put("type", 0);
        configParameter.setValue(value);
        configParameter.setComment("0:本地认证,1:SSO认证");
        configParameter.setClassName("");
        configParameter.setEnable(1);
        starterDAO.insertIgnore(configParameter);
    }
}
